package com.lge.clock.util;

/**
 * 2011.09.30 suein1209.kim
 * Meditate crazy clicking the 3D map enter button
 */
public class ThMeditate implements Runnable{

	/**
	 * delay star Time
	 */
	private int delaySec = 0;
	
	/**
	 * thread gubun
	 */
	private EmGubunMedit gubun;
	
	/**
	 * init
	 * @param delaySec
	 */
	public ThMeditate(int delaySec, EmGubunMedit gubun) {
		this.delaySec = delaySec;
		this.gubun = gubun;
		
		setFlagValue(false);
			
//		Log.i("suein", this.gubun.name()+"ThMeditate start : "+CommonUtil.MAP_ENTER_FLAG);
	} //End Of init
	
	@Override
	public void run() {
		try {
			Thread.sleep(this.delaySec);
		} catch (InterruptedException e) {
			/*Do nothing*/
			return;
		}//End Of try
		
		setFlagValue(true);
		
//		Log.i("suein", this.gubun.name()+this.gubun+"ThMeditate end : "+CommonUtil.MAP_ENTER_FLAG);
	} //End Of Method run
	
	/**
	 * set Enter of Leave flage value
	 * @param flag
	 */
	private void setFlagValue(boolean flag){
		if(this.gubun == EmGubunMedit.MAP_ENTER){
			CommonUtil.MAP_ENTER_FLAG = flag;
			
		}else{
			CommonUtil.MAP_LEAVE_FLAG = flag;
			
		}//End Of if
	} //End Of Method setFlagValue
	
} //End Of class
